package com.caption.mq.core;
import com.caption.mq.entity.MqSubscribeDO;
import com.caption.mq.handler.MessageHandler;

/**
 * @description: TODO
 * @author: 码农
 * @date: 2022-01-16 06:28:07
 */
public abstract class AbstractMqConsumer {

    protected MqSubscribeDO subscribe;

    public AbstractMqConsumer (MqSubscribeDO subscribeDO){
        this.subscribe =subscribeDO;
    }

    /**
     * 定义主题
     * @param topic
     * @param tag
     */
    abstract public void subscribe(String topic,String tag);

    /**
     * 注册消息处理器
     * @param messageHandler
     */
    abstract public void registerMessageHandler(MessageHandler messageHandler);

    abstract public void start();

    abstract public void stop();
}
